package com.hqyj.project.service.impl;

import com.hqyj.project.entity.Time;
import com.hqyj.project.entity.Work;
import com.hqyj.project.mapper.WorkMapper;
import com.hqyj.project.service.WorkService;
import com.hqyj.project.utils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkServiceImpl implements WorkService {
    @Autowired
    private WorkMapper workMapper;

    @Override
    public CommonResult selectInfo() {
        try {
            List<Work> works = workMapper.selectInfo();
            return new CommonResult(200,"查询成功",works);
        } catch (Exception e) {
            return new CommonResult(500,"查询失败");
        }
    }

    @Override
    public CommonResult updateInfo(Time time) {
            workMapper.updateInfo(time);
            return new CommonResult(200,"修改成功");
    }
}
